<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="<c:url value='/insdep/reset.min.css' />" rel="stylesheet" type="text/css">
	<link href="<c:url value='/insdep/easyui_full.css'/>" rel="stylesheet" type="text/css">
	<link href="<c:url value='/insdep/icon.css'/>" rel="stylesheet" type="text/css">
	<script type="text/javascript" src="<c:url value='/insdep/jquery-1.11.3.min.js'/>"></script>
	<script type="text/javascript" src="<c:url value='/insdep/jquery.easyui-1.5.2.min.js'/>"></script>
	<script type="text/javascript" src="<c:url value='/insdep/insdep-extend.min.js'/>"></script>
	
<title>编辑借款记录</title>
</head>
<body>
<!-- <script type="text/javascript">
$(function(){
	$.extend($.fn.validatebox.defaults.rules, {
		//电话格式输入验证
		Loanmoney : {
			validator : function(value) {
				return /^1[3-8][0-9]{9}$/i.test(value);
			},
			message : '请输入正确的电话号码!'
		}
	})
})
</script> -->

<script type="text/javascript">
$(function(){
	/**
	 *关闭编辑窗口
	 */
	$("#loan_no").linkbutton({
		onClick:function(){
			$("#loan_win").window('close');
		}
	});
	
	$("#loan_save").linkbutton({
		 onClick:function(){
			 $('#editloan_from').form({    
				    url:'saveloanInfo',    
				    onSubmit: function(param){    
				    	//param.roleState= $("#sstt").switchbutton("options").checked?1:0;
				    	
				    	return $(this).form('enableValidation').form('validate');//验证
				    },    
				    success:function(data){ 
				    	/**
				    	 *操作结果
				    	 */
				        if(data) {
							$("#loan_win").window('close');
							$('#loan_table').datagrid('reload');
							//提示信息
							$.messager.show({
								title:'提示',
								msg:'借款信息保存成功！', 
							    timeout:1000,  
								showType:'show',
								style:{
						            right:'',  
						            bottom:'' 
								}
							});
				        } else{
				        	//提示信息
				        	$("#loan_win").window('close');
							$('#loan_table').datagrid('reload');
				        	$.messager.show({
								title:'提示',
								msg:'借款信息保存失败', 
							    timeout:1000,  
								showType:'show',
								style:{
						            right:'',  
						            bottom:'' 
								}
							});
				        }   
				    }    
				});    
				$('#editloan_from').submit();  
		 }
	 });
	
})
</script>

	<form id="editloan_from" method="post">
		<div style="margin: 20px;">
			<!-- empName 录用人姓名 -->
			<input name="empId" type="hidden">
			<input name="loanlogLastmoney" type="hidden">
			<input name="empName" class="easyui-textbox" labelAlign='right'
			readonly="true" style="width: 96%" label="员工姓名：  " >
		</div>
		<div style="margin: 20px;">
			<!-- 借款余"money"-->			
			<!-- <input id="money" name="loanlogThismoney" class="easyui-textbox" labelAlign='right'
			required style="width: 96%" label="借款余额：" > -->
			<input id="money" name="loanlogThismoney" labelAlign='right' class="easyui-numberspinner"
			data-options="required:true,precision:1,groupSeparator:',',decimalSeparator:'.',prefix:'￥'"
			style="width: 96%" label="借款余额：" validType="length[0,12]">
		</div>
		<div style="margin: 20px;">
			<!-- 变更原因 -->
			<input name="loanlogNote" class="easyui-textbox" labelAlign='right'
			required multiline="true" style="width: 96%;height: 70px" label="变更原因："> 
		</div>
		<div style="margin: 20px 180px;position: relative;top:10px;">
			<a id="loan_save" class="easyui-linkbutton" 
				data-options="iconCls:'icon-submit',text:'保存'"></a>
			<a id="loan_no" class="easyui-linkbutton"
				data-options="iconCls:'icon-cancel',text:'取消'"></a>
		</div>
	</form>	
</body>
</html>